package com.example.mymvvmdemo.models.login;

import android.app.Activity;

import com.example.mymvvmdemo.MyApplication;
import com.example.mymvvmdemo.base.BaseViewModel;
import com.example.mymvvmdemo.constants.Constants;
import com.example.mymvvmdemo.models.forget.ForgetActivity;
import com.example.mymvvmdemo.models.main.MainActivity;
import com.example.mymvvmdemo.models.register.RegisterActivity;
import com.example.mymvvmdemo.utils.SpUtils;

public class LoginViewModel extends BaseViewModel {

    public boolean isRememberAccount = false;
    public boolean isRead = false;

    public void startMainActivity(Activity activity) {
        MainActivity.startMainActivity(activity);
    }

    public void startRegisterActivity(Activity activity) {
        RegisterActivity.startRegisterActivity(activity);
    }

    public void startForgetActivity(Activity activity) {
        ForgetActivity.startForgetActivity(activity);
    }

    public void saveUserAccount(String account, String password) {
        SpUtils.getSpUtils(MyApplication.getInstance(), Constants.ACCOUNT_NAME)
                .putValue(Constants.USER_ACCOUNT, account);
        SpUtils.getSpUtils(MyApplication.getInstance(), Constants.ACCOUNT_NAME)
                .putValue(Constants.USER_PASSWORD, password);
    }

}
